const fs = require('fs');
const Base64 = require('js-base64').Base64;

// 需要加密的字符串
const originalString = "2023-12-04";
const encodedString = Base64.encode(originalString);

// 需要替换的字符串
const searchString1 = "__BASE64_ENCODED_STRING_LS0tLS0tLS0t6L+H5pyf5LqGLS0tLS0tLQ==";
const searchString2 = "---------过期了-------";
const encodedString2 = Base64.encode(searchString2);

// 读取原始文件内容
const filePath = 'output.js'; // 替换为你的文件路径
let content = fs.readFileSync(filePath, 'utf8');

// 替换字符串
content = content.replace(searchString1, `"${encodedString}"`);
content = content.replace(searchString2, `"${encodedString2}"`);

// 输出结果
console.log(content);

// 如果需要，可以将修改后的内容写回文件
fs.writeFileSync(filePath, content, 'utf8');
